
global dir = ""
cd "$dir/results"

set more off
set matsize 10000
set scheme lean2 
graph set window fontface "Times New Roman"

import delimited "$dir/data/final_data.csv", clear

xtset obsid_num year 

label var lead_lnave_newsnum "Ln(Ave. \# Newsp.  Mentions) (t+1)"
label var lnave_newsnum "Ln(Ave. \# Newsp.  Mentions)"
label var lag_lnave_newsnum "Ln(Ave. \# Newsp.  Mentions) (t-1)"
label var lead_lnave_humanrights_newsnum "Ln(Ave. \# Newsp. Human Rights Mentions) (t+1)"
label var lead_lnnytapi_newsnum "Ln(NYT \# News)"
label var us_trend_std "Google U.S. Trends"
label var lnusgovt_count "Ln(\# WH \& DOS Mentions)"

label var hrs_violations "Human Rights Viol."
label var ideal_diff "UNGA Ideal Pt. Dist."

label var lngdp "Ln(GDP Per Capita)"
label var gdpgrowth "GDP Growth"
label var lnpopulation "Ln(Population Size)"
label var lnoil "Ln(Oil Prod. Per Capita)"
label var polyarchy "Polyarchy"
label var presidentialism "Presidentialism"
label var mediascore "Media Freedom"
label var lnprotest "Ln(Protest)"
label var election "Election"
label var intrastate_conflict "Intrastate conflict"
label var interstate_conflict "Interstate conflict"

label var unsc_temp "UNSC Seat"
label var ally "Ally"
label var log_imports "Ln(Import from the US)"
label var log_exports "Ln(Export to the US)"
label var log_econaid "Ln(Economic Aid)"
label var log_milaid "Ln(Military Aid)"
label var visit_from_us_pres "POTUS Visit"
label var visit_in_us_any "Visit to the US"

global domesticcov = "lngdp gdpgrowth lnpopulation lnoil polyarchy presidentialism mediascore lnprotest election intrastate_conflict interstate_conflict"
global intlcov = "unsc_temp ally log_imports log_exports log_econaid log_milaid visit_from_us_pres visit_in_us_any"

gen hrs_violations_ideal_diff = hrs_violations*ideal_diff
label var hrs_violations_ideal_diff "$\times$ UNGA Ideal Pt. Dist."

keep if year <= 2015

************************************
*** Table A1: Summary Statistics ***
************************************

global newsnum = "ave_newsnum ave_humanrights_newsnum nytimes_windex_newsnum wp_newsnum wsj_newsnum chicagotri_newsnum latimes_newsnum"
label var ave_newsnum "Ave. # Newsp.  Mentions"
label var ave_humanrights_newsnum "Ave. # Newsp. Human Rights Mentions"
label var nytimes_windex_newsnum "# NYT Mentions"
label var wp_newsnum "# WP Mentions"
label var wsj_newsnum "# WSJ Mentions"
label var chicagotri_newsnum "# CT Mentions"
label var latimes_newsnum "# LAT Mentions"
label var nytapi_senti "NYT Tone (API)"
label var nytapi_newsnum_pos "# NYT Positive Mentions (API)"
label var nytapi_newsnum_neg "# NYT Negative Mentions (API)"
label var us_trend_std "Google U.S. Trends"
label var usgovt_count "# WH & DOS Mentions"

sutex $newsnum nytapi_senti nytapi_newsnum_pos nytapi_newsnum_neg us_trend_std usgovt_count hrs_violations ideal_diff $domesticcov $intlcov, ///
lab nobs replace ///
file("Table_sumstat.tex") title("Summary Statistics") minmax

***************
*** Table 1 ***
***************

eststo clear 

global spec = "ab(obsid_num year) vce(cluster obsid_num)"

global main = "hrs_violations ideal_diff"

eststo m1: reghdfe lead_lnave_newsnum $main, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m2: reghdfe lead_lnave_newsnum $main $domesticcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m3: reghdfe lead_lnave_newsnum $main $domesticcov $intlcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

global main = "hrs_violations hrs_violations_ideal_diff ideal_diff"

eststo m4: reghdfe lead_lnave_newsnum $main, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m5: reghdfe lead_lnave_newsnum $main $domesticcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m6: reghdfe lead_lnave_newsnum $main $domesticcov $intlcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

esttab m1 m2 m3 m4 m5 m6 using "Table_hrviolations_mediaattention.tex", b(3) se(3) noomitted ///
keep($main $domesticcov $intlcov) ///
order($main $domesticcov $intlcov) ///
star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label ///
nomtitles nonotes nogaps ///
mgroup("Ln(Ave. \# Newsp.  Mentions)", pattern(1 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
stats(ldrfe yrfe r2_a nldr N period, labels("Leader fixed-effects" "Year fixed-effects" "Adjusted R$^2$" "Number of leaders" "Observations" "Period") fmt(0 0 3 0 0 0)) ///
replace tex

****************
*** Figure 2 ***
****************

interflex lead_lnave_newsnum hrs_violations ideal_diff, cluster(obsid_num) fe(obsid_num year) ylabel("Y") xlabel("UNGA Ideal Pt. Dist.") title("D = Human Rights Viol. (w/o controls)") yrange(-1 0.5) type(kernel)
graph rename Figure_A, replace

interflex lead_lnave_newsnum hrs_violations ideal_diff $domesticcov $intlcov, cluster(obsid_num) fe(obsid_num year) ylabel("Y") xlabel("UNGA Ideal Pt. Dist.") title("D = Human Rights Viol. (w/ controls)") yrange(-1 0.5) type(kernel)
graph rename Figure_B, replace

graph combine Figure_A Figure_B, col(2) xcommon ycommon
graph export "Figure_hrviolations_mediaattention.png", width(5000) replace

***************
*** Table 2 ***
***************

eststo clear 

global spec = "ab(obsid_num year) vce(cluster obsid_num)"

global main = "hrs_violations ideal_diff"

eststo m1: reghdfe lead_lnave_humanrights_newsnum $main, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m2: reghdfe lead_lnave_humanrights_newsnum $main $domesticcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m3: reghdfe lead_lnave_humanrights_newsnum $main $domesticcov $intlcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

global main = "hrs_violations hrs_violations_ideal_diff ideal_diff"

eststo m4: reghdfe lead_lnave_humanrights_newsnum $main, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m5: reghdfe lead_lnave_humanrights_newsnum $main $domesticcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m6: reghdfe lead_lnave_humanrights_newsnum $main $domesticcov $intlcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

esttab m1 m2 m3 m4 m5 m6 using "Table_hrviolations_mediaattention_hr.tex", b(3) se(3) noomitted ///
keep($main) ///
order($main) ///
star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label ///
nomtitles nonotes nogaps ///
mgroup("Ln(Ave. \# Newsp.  Human Rights Mentions)", pattern(1 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
stats(domesticcov intlcov ldrfe yrfe r2_a nldr N period, labels("Domestic controls" "U.S.-related controls" "Leader fixed-effects" "Year fixed-effects" "Adjusted R$^2$" "Number of leaders" "Observations" "Period") fmt(0 0 0 0 3 0 0 0)) ///
replace tex

***************
*** Table 3 ***
***************

eststo clear 

global spec = "ab(obsid_num year) vce(cluster obsid_num)"

global main = "hrs_violations hrs_violations_ideal_diff ideal_diff"

eststo m1: reghdfe lead_lnnytapi_newsnum_pos $main, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m2: reghdfe lead_lnnytapi_newsnum_pos $main $domesticcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m3: reghdfe lead_lnnytapi_newsnum_pos $main $domesticcov $intlcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m4: reghdfe lead_lnnytapi_newsnum_neg $main, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m5: reghdfe lead_lnnytapi_newsnum_neg $main $domesticcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m6: reghdfe lead_lnnytapi_newsnum_neg $main $domesticcov $intlcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

esttab m1 m2 m3 m4 m5 m6 using "Table_hrviolations_mediaattention_nytcoverage.tex", b(3) se(3) noomitted ///
keep($main) ///
order($main) ///
star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label ///
nomtitles nonotes nogaps ///
mgroup("Ln(\# NYT Positive Mentions)" "Ln(\# NYT Negative Mentions)", pattern(1 0 0 1 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
stats(domesticcov intlcov ldrfe yrfe r2_a nldr N period, labels("Domestic Controls" "U.S.-related controls" "Leader fixed-effects" "Year fixed-effects" "Adjusted R$^2$" "Number of leaders" "Observations" "Period") fmt(0 0 0 0 3 0 0 0)) ///
replace tex

***************
*** Table 4 ***
***************

eststo clear 

global spec = "ab(obsid_num year) vce(cluster obsid_num)"

global main = "hrs_violations hrs_violations_ideal_diff ideal_diff"

eststo m1: reghdfe lnave_newsnum $main if year >= 2001, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "2001-2015"

eststo m2: reghdfe lnave_newsnum $main $domesticcov if year >= 2001, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "2001-2015"

eststo m3: reghdfe lnave_newsnum $main $domesticcov $intlcov if year >= 2001, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "2001-2015"

eststo m4: reghdfe lnusgovt_count $main if year >= 2001, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "2001-2015"

eststo m5: reghdfe lnusgovt_count $main $domesticcov if year >= 2001, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "2001-2015"

eststo m6: reghdfe lnusgovt_count $main $domesticcov $intlcov if year >= 2001, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "2001-2015"

eststo m7: reghdfe lnave_newsnum lnusgovt_count $main if year >= 2001, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "2001-2015"

eststo m8: reghdfe lnave_newsnum lnusgovt_count $main $domesticcov if year >= 2001, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "2001-2015"

eststo m9: reghdfe lnave_newsnum lnusgovt_count $main $domesticcov $intlcov if year >= 2001, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "2001-2015"

esttab m1 m2 m3 m4 m5 m6 m7 m8 m9 using "Table_hrviolations_mediaattention_mechanism_baronkenny.tex", b(3) se(3) noomitted ///
keep($main lnusgovt_count) ///
order($main lnusgovt_count) ///
star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label ///
nomtitles nonotes nogaps ///
mgroup("Ln(Ave. \# Newsp. Mentions)" "Ln(\# WH \& DOS Mentions)" "Ln(Ave. \# Newsp. Mentions)", pattern(1 0 0 1 0 0 1 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
stats(domesticcov intlcov ldrfe yrfe r2_a nldr N period, labels("Domestic controls" "U.S.-related controls" "Leader fixed-effects" "Year fixed-effects" "Adjusted R$^2$" "Number of leaders" "Observations" "Period") fmt(0 0 0 0 3 0 0 0)) ///
replace tex

****************
*** Table B1 ***
****************

egen hrs_violations_median = median(hrs_violations)
generate hrs_violator = 0
replace hrs_violator = 1 if hrs_violations > hrs_violations_median
tab hrs_violator
label var hrs_violator "Human Rights Violator"

egen ideal_diff_median = median(ideal_diff)
generate enemy = 0
replace enemy = 1 if ideal_diff > ideal_diff_median
tab enemy
label var enemy "U.S. Enemy"

cor hrs_violations ideal_diff
cor hrs_violator enemy

gen hrs_violator_enemy = hrs_violator*enemy
label var hrs_violator_enemy "$\times$ U.S. Enemy"

eststo clear 

global spec = "ab(obsid_num year) vce(cluster obsid_num)"

global main = "hrs_violator enemy"

eststo m1: reghdfe lead_lnave_newsnum $main, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m2: reghdfe lead_lnave_newsnum $main $domesticcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m3: reghdfe lead_lnave_newsnum $main $domesticcov $intlcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

global main = "hrs_violator hrs_violator_enemy enemy"

eststo m4: reghdfe lead_lnave_newsnum $main, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m5: reghdfe lead_lnave_newsnum $main $domesticcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m6: reghdfe lead_lnave_newsnum $main $domesticcov $intlcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

esttab m1 m2 m3 m4 m5 m6 using "Table_hrviolations_mediaattention_dummy.tex", b(3) se(3) noomitted ///
keep($main $domesticcov $intlcov) ///
order($main $domesticcov $intlcov) ///
star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label ///
nomtitles nonotes nogaps ///
mgroup("Ln(Ave. \# Newsp. Mentions)", pattern(1 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
stats(ldrfe yrfe r2_a nldr N period, labels("Leader fixed-effects" "Year fixed-effects" "Adjusted R$^2$" "Number of leaders" "Observations" "Period") fmt(0 0 3 0 0 0)) ///
replace tex

****************
*** Table B2 ***
****************

eststo clear 

global spec = "ab(obsid_num year) vce(cluster obsid_num)"

global main = "hrs_violations ideal_diff"

preserve 

keep if ideal_diff_ave_bottom25 == 1

eststo m1: reghdfe lead_lnave_newsnum $main, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m2: reghdfe lead_lnave_newsnum $main $domesticcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m3: reghdfe lead_lnave_newsnum $main $domesticcov $intlcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

restore

preserve 

keep if ideal_diff_ave_top25 == 1

eststo m4: reghdfe lead_lnave_newsnum $main, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m5: reghdfe lead_lnave_newsnum $main $domesticcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m6: reghdfe lead_lnave_newsnum $main $domesticcov $intlcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

restore

esttab m1 m2 m3 m4 m5 m6 using "Table_hrviolations_mediaattention_bypolialign.tex", b(3) se(3) noomitted ///
keep($main $domesticcov $intlcov) ///
order($main $domesticcov $intlcov) ///
star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label ///
nomtitles nonotes nogaps ///
mgroup("Aligned Leaders" "Non-aligned Leaders", pattern(1 0 0 1 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
stats(ldrfe yrfe r2_a nldr N period, labels("Leader fixed-effects" "Year fixed-effects" "Adjusted R$^2$" "Number of leaders" "Observations" "Period") fmt(0 0 3 0 0 0)) ///
replace tex

****************
*** Table B4 ***
****************

eststo clear 

global spec = "ab(obsid_num year) vce(cluster obsid_num)"

global main = "hrs_violations ideal_diff"

eststo m1: reghdfe lnave_newsnum $main, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m2: reghdfe lnave_newsnum $main $domesticcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m3: reghdfe lnave_newsnum $main $domesticcov $intlcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

global main = "hrs_violations hrs_violations_ideal_diff ideal_diff"

eststo m4: reghdfe lnave_newsnum $main, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m5: reghdfe lnave_newsnum $main $domesticcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m6: reghdfe lnave_newsnum $main $domesticcov $intlcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

esttab m1 m2 m3 m4 m5 m6 using "Table_hrviolations_mediaattention_nolead.tex", b(3) se(3) noomitted ///
keep($main $domesticcov $intlcov) ///
order($main $domesticcov $intlcov) ///
star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label ///
nomtitles nonotes nogaps ///
mgroup("Ln(Ave. \# Newsp.  Mentions)", pattern(1 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
stats(ldrfe yrfe r2_a nldr N period, labels("Leader fixed-effects" "Year fixed-effects" "Adjusted R$^2$" "Number of leaders" "Observations" "Period") fmt(0 0 3 0 0)) ///
replace tex

****************
*** Table B5 ***
****************

eststo clear 

global spec = "fe vce(robust)"

global main = "i.year hrs_violations ideal_diff"

eststo m1: xtpoisson lead_ave_newsnum $main, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local period "1960-2015"

eststo m2: xtpoisson lead_ave_newsnum $main $domesticcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local period "1960-2015"

eststo m3: xtpoisson lead_ave_newsnum $main $domesticcov $intlcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local period "1960-2015"

global main = "i.year hrs_violations hrs_violations_ideal_diff ideal_diff"

eststo m4: xtpoisson lead_ave_newsnum $main, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local period "1960-2015"

eststo m5: xtpoisson lead_ave_newsnum $main $domesticcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local period "1960-2015"

eststo m6: xtpoisson lead_ave_newsnum $main $domesticcov $intlcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local period "1960-2015"

global main = "hrs_violations hrs_violations_ideal_diff ideal_diff"

esttab m1 m2 m3 m4 m5 m6 using "Table_hrviolations_mediaattention_poisson.tex", b(3) se(3) noomitted ///
keep($main $domesticcov $intlcov) ///
order($main $domesticcov $intlcov) ///
star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label ///
nomtitles nonotes nogaps eqlabel(none) ///
mgroup("Ave. \# Newsp.  Mentions", pattern(1 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
stats(ldrfe yrfe N period, labels("Leader fixed-effects" "Year fixed-effects" "Observations" "Period") fmt(0 0 0)) ///
replace tex

****************
*** Table B6 ***
****************

eststo clear 

global spec = "ab(obsid_num year) vce(cluster obsid_num)"

global main = "hrs_violations hrs_violations_ideal_diff ideal_diff"

eststo m1: reghdfe lead_lnave_newsnum $main, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m2: reghdfe lead_lnave_newsnum $main c.lngdp##c.ideal_diff c.gdpgrowth##c.ideal_diff c.lnpopulation##c.ideal_diff /// 
c.lnoil##c.ideal_diff c.polyarchy##c.ideal_diff c.presidentialism##c.ideal_diff c.mediascore##c.ideal_diff c.lnprotest##c.ideal_diff i.election##c.ideal_diff i.intrastate_conflict##c.ideal_diff i.interstate_conflict##c.ideal_diff, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m3: reghdfe lead_lnave_newsnum $main c.lngdp##c.ideal_diff c.gdpgrowth##c.ideal_diff c.lnpopulation##c.ideal_diff /// 
c.lnoil##c.ideal_diff c.polyarchy##c.ideal_diff c.presidentialism##c.ideal_diff c.mediascore##c.ideal_diff c.lnprotest##c.ideal_diff i.election##c.ideal_diff i.intrastate_conflict##c.ideal_diff i.interstate_conflict##c.ideal_diff ///
i.unsc_temp##c.ideal_diff i.ally##c.ideal_diff c.log_imports##c.ideal_diff c.log_exports##c.ideal_diff ///
c.log_econaid##c.ideal_diff c.log_milaid##c.ideal_diff i.visit_from_us_pres##c.ideal_diff i.visit_in_us_any##c.ideal_diff, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

esttab m1 m2 m3 using "Table_hrviolations_mediaattention_fullymoderatedmodel1.tex", b(3) se(3) noomitted ///
keep($main) ///
order($main) ///
star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label ///
nomtitles nonotes nogaps ///
mgroup("Ln(Ave. \# Newsp.  Mentions)", pattern(1 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
stats(domesticcov intlcov ldrfe yrfe r2_a nldr N period, labels("Domestic controls" "U.S.-related controls" "Leader fixed-effects" "Year fixed-effects" "Adjusted R$^2$" "Number of leaders" "Observations" "Period") fmt(0 0 0 0 3 0 0 0)) ///
replace tex

****************
*** Table B7 ***
****************

eststo clear 

global spec = "ab(obsid_num year) vce(cluster obsid_num)"

global main = "hrs_violations hrs_violations_ideal_diff ideal_diff"

eststo m1: reghdfe lead_lnave_newsnum $main, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m2: reghdfe lead_lnave_newsnum $main c.lngdp##c.hrs_violations c.gdpgrowth##c.hrs_violations c.lnpopulation##c.hrs_violations /// 
c.lnoil##c.hrs_violations c.polyarchy##c.hrs_violations c.presidentialism##c.hrs_violations c.mediascore##c.hrs_violations c.lnprotest##c.hrs_violations i.election##c.hrs_violations i.intrastate_conflict##c.hrs_violations i.interstate_conflict##c.hrs_violations, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m3: reghdfe lead_lnave_newsnum $main c.lngdp##c.hrs_violations c.gdpgrowth##c.hrs_violations c.lnpopulation##c.hrs_violations /// 
c.lnoil##c.hrs_violations c.polyarchy##c.hrs_violations c.presidentialism##c.hrs_violations c.mediascore##c.hrs_violations c.lnprotest##c.hrs_violations i.election##c.hrs_violations i.intrastate_conflict##c.hrs_violations i.interstate_conflict##c.hrs_violations ///
i.unsc_temp##c.hrs_violations i.ally##c.hrs_violations c.log_imports##c.hrs_violations c.log_exports##c.hrs_violations ///
c.log_econaid##c.hrs_violations c.log_milaid##c.hrs_violations i.visit_from_us_pres##c.hrs_violations i.visit_in_us_any##c.hrs_violations, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

esttab m1 m2 m3 using "Table_hrviolations_mediaattention_fullymoderatedmodel2.tex", b(3) se(3) noomitted ///
keep($main) ///
order($main) ///
star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label ///
nomtitles nonotes nogaps ///
mgroup("Ln(Ave. \# Newsp.  Mentions)", pattern(1 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
stats(domesticcov intlcov ldrfe yrfe r2_a nldr N period, labels("Domestic controls" "U.S.-related controls" "Leader fixed-effects" "Year fixed-effects" "Adjusted R$^2$" "Number of leaders" "Observations" "Period") fmt(0 0 0 0 3 0 0 0)) ///
replace tex

****************
*** Table B8 ***
****************

eststo clear 

global spec = ""

global main = "hrs_violations ideal_diff"

eststo m1: xtreg lead_lnave_newsnum $main, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe ""
estadd local yrfe ""
estadd local nldr `e(N_g)'
estadd local period "1960-2015"

eststo m2: xtreg lead_lnave_newsnum $main $domesticcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe ""
estadd local yrfe ""
estadd local nldr `e(N_g)'
estadd local period "1960-2015"

eststo m3: xtreg lead_lnave_newsnum $main $domesticcov $intlcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe ""
estadd local yrfe ""
estadd local nldr `e(N_g)'
estadd local period "1960-2015"

global main = "hrs_violations hrs_violations_ideal_diff ideal_diff"

eststo m4: xtreg lead_lnave_newsnum $main, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe ""
estadd local yrfe ""
estadd local nldr `e(N_g)'
estadd local period "1960-2015"

eststo m5: xtreg lead_lnave_newsnum $main $domesticcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe ""
estadd local yrfe ""
estadd local nldr `e(N_g)'
estadd local period "1960-2015"

eststo m6: xtreg lead_lnave_newsnum $main $domesticcov $intlcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe ""
estadd local yrfe ""
estadd local nldr `e(N_g)'
estadd local period "1960-2015"

esttab m1 m2 m3 m4 m5 m6 using "Table_hrviolations_mediaattention_nofe.tex", b(3) se(3) noomitted ///
keep($main $domesticcov $intlcov) ///
order($main $domesticcov $intlcov) ///
star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label ///
nomtitles nonotes nogaps ///
mgroup("Ln(Ave. \# Newsp.  Mentions)", pattern(1 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
stats(ldrfe yrfe r2_o nldr N period, labels("Leader fixed-effects" "Year fixed-effects" "Adjusted R$^2$" "Number of leaders" "Observations" "Period") fmt(0 0 3 0 0 0)) ///
replace tex

****************
*** Table B9 ***
****************

eststo clear 

global spec = "obsid_num:year, vce(cluster obsid_num)"

global main = "hrs_violations ideal_diff"

eststo m1: mixed lead_lnave_newsnum $main || $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrme "$\checkmark$"
estadd local yrme "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m2: mixed lead_lnave_newsnum $main $domesticcov || $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrme "$\checkmark$"
estadd local yrme "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m3: mixed lead_lnave_newsnum $main $domesticcov $intlcov || $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrme "$\checkmark$"
estadd local yrme "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

global main = "hrs_violations hrs_violations_ideal_diff ideal_diff"

eststo m4: mixed lead_lnave_newsnum $main || $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrme "$\checkmark$"
estadd local yrme "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m5: mixed lead_lnave_newsnum $main $domesticcov || $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrme "$\checkmark$"
estadd local yrme "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m6: mixed lead_lnave_newsnum $main $domesticcov $intlcov || $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrme "$\checkmark$"
estadd local yrme "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

esttab m1 m2 m3 m4 m5 m6 using "Table_hrviolations_mediaattention_mixedeffects.tex", b(3) se(3) noomitted ///
keep($main $domesticcov $intlcov) ///
order($main $domesticcov $intlcov) ///
star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label ///
nomtitles nonotes nogaps eqlabel(none) ///
mgroup("Ln(Ave. \# Newsp.  Mentions)", pattern(1 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
stats(ldrme yrme nldr N period, labels("Leader mixed-effects" "Year mixed-effects" "Number of leaders" "Observations" "Period") fmt(0 0 0 0 0)) ///
replace tex

*****************
*** Table B10 ***
*****************

preserve

drop if hrs_violations_ave_top25 == 1 & ideal_diff_ave_top25 == 1

eststo clear 

global spec = "ab(obsid_num year) vce(cluster obsid_num)"

global main = "hrs_violations ideal_diff"

eststo m1: reghdfe lead_lnave_newsnum $main if ccode != 710 & ccode != 630 & ccode != 365, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m2: reghdfe lead_lnave_newsnum $main $domesticcov if ccode != 710 & ccode != 630 & ccode != 365, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m3: reghdfe lead_lnave_newsnum $main $domesticcov $intlcov if ccode != 710 & ccode != 630 & ccode != 365, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

global main = "hrs_violations hrs_violations_ideal_diff ideal_diff"

eststo m4: reghdfe lead_lnave_newsnum $main if ccode != 710 & ccode != 630 & ccode != 365, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m5: reghdfe lead_lnave_newsnum $main $domesticcov if ccode != 710 & ccode != 630 & ccode != 365, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m6: reghdfe lead_lnave_newsnum $main $domesticcov $intlcov if ccode != 710 & ccode != 630 & ccode != 365, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

restore 

esttab m1 m2 m3 m4 m5 m6 using "Table_hrviolations_mediaattention_excludeHH.tex", b(3) se(3) noomitted ///
keep($main $domesticcov $intlcov) ///
order($main $domesticcov $intlcov) ///
star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label ///
nomtitles nonotes nogaps ///
mgroup("Ln(Ave. \# Newsp.  Mentions)", pattern(1 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
stats(ldrfe yrfe r2_a nldr N period, labels("Leader fixed-effects" "Year fixed-effects" "Adjusted R$^2$" "Number of leaders" "Observations" "Period") fmt(0 0 3 0 0)) ///
replace tex

*****************
*** Table B11 ***
*****************

preserve

drop if hrs_violations_ave_top25 == 1 & ideal_diff_ave_bottom25 == 1

eststo clear 

global spec = "ab(obsid_num year) vce(cluster obsid_num)"

global main = "hrs_violations ideal_diff"

eststo m1: reghdfe lead_lnave_newsnum $main if ccode != 710 & ccode != 630 & ccode != 365, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m2: reghdfe lead_lnave_newsnum $main $domesticcov if ccode != 710 & ccode != 630 & ccode != 365, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m3: reghdfe lead_lnave_newsnum $main $domesticcov $intlcov if ccode != 710 & ccode != 630 & ccode != 365, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

global main = "hrs_violations hrs_violations_ideal_diff ideal_diff"

eststo m4: reghdfe lead_lnave_newsnum $main if ccode != 710 & ccode != 630 & ccode != 365, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m5: reghdfe lead_lnave_newsnum $main $domesticcov if ccode != 710 & ccode != 630 & ccode != 365, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m6: reghdfe lead_lnave_newsnum $main $domesticcov $intlcov if ccode != 710 & ccode != 630 & ccode != 365, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

restore 

esttab m1 m2 m3 m4 m5 m6 using "Table_hrviolations_mediaattention_excludeHL.tex", b(3) se(3) noomitted ///
keep($main $domesticcov $intlcov) ///
order($main $domesticcov $intlcov) ///
star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label ///
nomtitles nonotes nogaps ///
mgroup("Ln(Ave. \# Newsp.  Mentions)", pattern(1 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
stats(ldrfe yrfe r2_a nldr N period, labels("Leader fixed-effects" "Year fixed-effects" "Adjusted R$^2$" "Number of leaders" "Observations" "Period") fmt(0 0 3 0 0)) ///
replace tex

*****************
*** Table B12 ***
*****************

preserve

drop if hrs_violations_ave_bottom25 == 1 & ideal_diff_ave_top25 == 1

eststo clear 

global spec = "ab(obsid_num year) vce(cluster obsid_num)"

global main = "hrs_violations ideal_diff"

eststo m1: reghdfe lead_lnave_newsnum $main if ccode != 710 & ccode != 630 & ccode != 365, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m2: reghdfe lead_lnave_newsnum $main $domesticcov if ccode != 710 & ccode != 630 & ccode != 365, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m3: reghdfe lead_lnave_newsnum $main $domesticcov $intlcov if ccode != 710 & ccode != 630 & ccode != 365, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

global main = "hrs_violations hrs_violations_ideal_diff ideal_diff"

eststo m4: reghdfe lead_lnave_newsnum $main if ccode != 710 & ccode != 630 & ccode != 365, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m5: reghdfe lead_lnave_newsnum $main $domesticcov if ccode != 710 & ccode != 630 & ccode != 365, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m6: reghdfe lead_lnave_newsnum $main $domesticcov $intlcov if ccode != 710 & ccode != 630 & ccode != 365, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

restore 

esttab m1 m2 m3 m4 m5 m6 using "Table_hrviolations_mediaattention_excludeLH.tex", b(3) se(3) noomitted ///
keep($main $domesticcov $intlcov) ///
order($main $domesticcov $intlcov) ///
star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label ///
nomtitles nonotes nogaps ///
mgroup("Ln(Ave. \# Newsp.  Mentions)", pattern(1 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
stats(ldrfe yrfe r2_a nldr N period, labels("Leader fixed-effects" "Year fixed-effects" "Adjusted R$^2$" "Number of leaders" "Observations" "Period") fmt(0 0 3 0 0)) ///
replace tex

*****************
*** Table B13 ***
*****************

preserve

drop if hrs_violations_ave_bottom25 == 1 & ideal_diff_ave_bottom25 == 1

eststo clear 

global spec = "ab(obsid_num year) vce(cluster obsid_num)"

global main = "hrs_violations ideal_diff"

eststo m1: reghdfe lead_lnave_newsnum $main if ccode != 710 & ccode != 630 & ccode != 365, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m2: reghdfe lead_lnave_newsnum $main $domesticcov if ccode != 710 & ccode != 630 & ccode != 365, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m3: reghdfe lead_lnave_newsnum $main $domesticcov $intlcov if ccode != 710 & ccode != 630 & ccode != 365, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

global main = "hrs_violations hrs_violations_ideal_diff ideal_diff"

eststo m4: reghdfe lead_lnave_newsnum $main if ccode != 710 & ccode != 630 & ccode != 365, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m5: reghdfe lead_lnave_newsnum $main $domesticcov if ccode != 710 & ccode != 630 & ccode != 365, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m6: reghdfe lead_lnave_newsnum $main $domesticcov $intlcov if ccode != 710 & ccode != 630 & ccode != 365, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

restore 

esttab m1 m2 m3 m4 m5 m6 using "Table_hrviolations_mediaattention_excludeLL.tex", b(3) se(3) noomitted ///
keep($main $domesticcov $intlcov) ///
order($main $domesticcov $intlcov) ///
star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label ///
nomtitles nonotes nogaps ///
mgroup("Ln(Ave. \# Newsp.  Mentions)", pattern(1 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
stats(ldrfe yrfe r2_a nldr N period, labels("Leader fixed-effects" "Year fixed-effects" "Adjusted R$^2$" "Number of leaders" "Observations" "Period") fmt(0 0 3 0 0)) ///
replace tex

*****************
*** Figure D1 ***
*****************

sensemakr lead_lnave_newsnum i.obsid_num i.year hrs_violations hrs_violations_ideal_diff ideal_diff $domesticcov $intlcov, treat(hrs_violations_ideal_diff) benchmark(lnoil) kd(10) contourplot

graph export "Figure_sensitivity_analysis_oil.png", width(5000) replace

sensemakr lead_lnave_newsnum i.obsid_num i.year hrs_violations hrs_violations_ideal_diff ideal_diff $domesticcov $intlcov, treat(hrs_violations_ideal_diff) benchmark(intrastate_conflict) kd(10) contourplot

graph export "Figure_sensitivity_analysis_civilwar.png", width(5000) replace

*****************
*** Figure D2 ***
*****************

rename lead_lnave_humanrights_newsnum lead_lnave_hr_newsnum

interflex lead_lnave_hr_newsnum hrs_violations ideal_diff, cluster(obsid_num) fe(obsid_num year) ylabel("Y") xlabel("UNGA Ideal Pt. Dist.") title("D = Human Rights Viol. (w/o controls)") yrange(-1 0.5) 
graph rename Figure_A, replace

interflex lead_lnave_hr_newsnum hrs_violations ideal_diff $domesticcov $intlcov, cluster(obsid_num) fe(obsid_num year) ylabel("Y") xlabel("UNGA Ideal Pt. Dist.") title("D = Human Rights Viol. (w/ controls)") yrange(-1 0.5)
graph rename Figure_B, replace

graph combine Figure_A Figure_B, col(2) xcommon ycommon
graph export "Figure_hrviolations_mediaattention_hr.png", width(5000) replace

*****************
*** Table D1 ***
*****************

eststo clear 

global spec = "ab(obsid_num year) vce(cluster obsid_num)"

global main = "hrs_violations ideal_diff"

eststo m1: reghdfe lnave_humanrights_newsnum $main, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m2: reghdfe lnave_humanrights_newsnum $main $domesticcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m3: reghdfe lnave_humanrights_newsnum $main $domesticcov $intlcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

global main = "hrs_violations hrs_violations_ideal_diff ideal_diff"

eststo m4: reghdfe lnave_humanrights_newsnum $main, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m5: reghdfe lnave_humanrights_newsnum $main $domesticcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m6: reghdfe lnave_humanrights_newsnum $main $domesticcov $intlcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

esttab m1 m2 m3 m4 m5 m6 using "Table_hrviolations_mediaattention_hr_nolead.tex", b(3) se(3) noomitted ///
keep($main) ///
order($main) ///
star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label ///
nomtitles nonotes nogaps ///
mgroup("Ln(Ave. \# Newsp.  Human Rights Mentions)", pattern(1 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
stats(domesticcov intlcov ldrfe yrfe r2_a nldr N period, labels("Domestic controls" "U.S.-related controls" "Leader fixed-effects" "Year fixed-effects" "Adjusted R$^2$" "Number of leaders" "Observations" "Period") fmt(0 0 0 0 3 0 0 0)) ///
replace tex

*****************
*** Table D2 ***
*****************

eststo clear 

global spec = "ab(obsid_num year) vce(cluster obsid_num)"

global main = "lnave_newsnum lag_lnave_newsnum hrs_violations ideal_diff"

eststo m1: reghdfe lead_lnave_newsnum $main, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m2: reghdfe lead_lnave_newsnum $main $domesticcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m3: reghdfe lead_lnave_newsnum $main $domesticcov $intlcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

global main = "lnave_newsnum lag_lnave_newsnum hrs_violations hrs_violations_ideal_diff ideal_diff"

eststo m4: reghdfe lead_lnave_newsnum $main, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m5: reghdfe lead_lnave_newsnum $main $domesticcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m6: reghdfe lead_lnave_newsnum $main $domesticcov $intlcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

esttab m1 m2 m3 m4 m5 m6 using "Table_hrviolations_mediaattention_LDV.tex", b(3) se(3) noomitted ///
keep($main $domesticcov $intlcov) ///
order($main $domesticcov $intlcov) ///
star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label ///
nomtitles nonotes nogaps ///
mgroup("Ln(Ave. \# Newsp.  Mentions)", pattern(1 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
stats(ldrfe yrfe r2_a nldr N period, labels("Leader fixed-effects" "Year fixed-effects" "Adjusted R$^2$" "Number of leaders" "Observations" "Period") fmt(0 0 3 0 0 0)) ///
replace tex

*****************
*** Table D3 ***
*****************

eststo clear 

global spec = "ab(obsid_num year) vce(cluster obsid_num)"

global main = "lnave_newsnum"

eststo m1: reghdfe us_trend_std $main if year >= 2004, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "2004-2015"

eststo m2: reghdfe us_trend_std $main $domesticcov if year >= 2004, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "2004-2015"

eststo m3: reghdfe us_trend_std $main $domesticcov $intlcov if year >= 2004, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "2004-2015"

esttab m1 m2 m3 using "Table_hrviolations_mediaattention_demanddrivenbias_correlation.tex", b(3) se(3) noomitted ///
keep($main) ///
order($main) ///
star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label ///
nomtitles nonotes nogaps ///
mgroup("Google Trends in the U.S.", pattern(1 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
stats(domesticcov intlcov ldrfe yrfe r2_a nldr N period, labels("Domestic controls" "U.S.-related controls" "Leader fixed-effects" "Year fixed-effects" "Adjusted R$^2$" "Number of leaders" "Observations" "Period") fmt(0 0 0 0 3 0 0)) ///
replace tex

****************
*** Table D4 ***
****************

eststo clear 

global spec = "ab(obsid_num year) vce(cluster obsid_num)"

global main = "hrs_violations hrs_violations_ideal_diff ideal_diff"

eststo m1: reghdfe lnave_newsnum $main if year >= 2004, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "2004-2015"

eststo m2: reghdfe lnave_newsnum $main $domesticcov if year >= 2004, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "2004-2015"

eststo m3: reghdfe lnave_newsnum $main $domesticcov $intlcov if year >= 2004, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "2004-2015"

global main = "hrs_violations hrs_violations_ideal_diff ideal_diff"

eststo m4: reghdfe us_trend_std $main if year >= 2004, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "2004-2015"

eststo m5: reghdfe us_trend_std $main $domesticcov if year >= 2004, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "2004-2015"

eststo m6: reghdfe us_trend_std $main $domesticcov $intlcov if year >= 2004, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "2004-2015"

esttab m1 m2 m3 m4 m5 m6 using "Table_hrviolations_mediaattention_demanddrivenbias.tex", b(3) se(3) noomitted ///
keep($main) ///
order($main) ///
star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label ///
nomtitles nonotes nogaps ///
mgroup("Ln(Ave. \# Newsp.  Mentions)" "Google Trends in the U.S.", pattern(1 0 0 1 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
stats(domesticcov intlcov ldrfe yrfe r2_a nldr N period, labels("Domestic controls" "U.S.-related controls" "Leader fixed-effects" "Year fixed-effects" "Adjusted R$^2$" "Number of leaders" "Observations" "Period") fmt(0 0 0 0 3 0 0)) ///
replace tex

****************
*** Table E1 ***
****************

gen hrs_violations_democratic = hrs_violations*democratic
label var hrs_violations_democratic "$\times$ Democratic"

gen ideal_diff_democratic = ideal_diff*democratic 
label var ideal_diff_democratic "$\times$ Democratic"

gen hrs_violations_ideal_diff_demo = hrs_violations_ideal_diff*democratic
label var hrs_violations_ideal_diff_demo "$\times$ UNGA Ideal Pt. Dist $\times$ Democratic"

eststo clear

global spec = "ab(obsid_num year) vce(cluster obsid_num)"

global main = "hrs_violations hrs_violations_ideal_diff ideal_diff"

eststo m1: reghdfe lead_lnave_newsnum $main if year <= 1991, $spec
estadd local controls ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "CW"

eststo m2: reghdfe lead_lnave_newsnum $main $domesticcov $intlcov if year <= 1991, $spec
estadd local controls "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "CW"

eststo m3: reghdfe lead_lnave_newsnum $main if year >= 1992, $spec
estadd local controls ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "P-CW"

eststo m4: reghdfe lead_lnave_newsnum $main $domesticcov $intlcov if year >= 1992, $spec
estadd local controls "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "P-CW"

global main = "hrs_violations hrs_violations_ideal_diff hrs_violations_democratic hrs_violations_ideal_diff_demo ideal_diff  ideal_diff_democratic"

eststo m5: reghdfe lead_lnave_newsnum $main if year <= 1991, $spec
estadd local controls ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "CW"

eststo m6: reghdfe lead_lnave_newsnum $main $domesticcov $intlcov if year <= 1991, $spec
estadd local controls "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "CW"

eststo m7: reghdfe lead_lnave_newsnum $main if year >= 1992, $spec
estadd local controls ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "P-CW"

eststo m8: reghdfe lead_lnave_newsnum $main $domesticcov $intlcov if year >= 1992, $spec
estadd local controls "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "P-CW"

esttab m1 m2 m3 m4 m5 m6 m7 m8 using "Table_hrviolations_mediaattention_bydemrep.tex", b(3) se(3) noomitted ///
keep($main) ///
order($main $domesticcov $intlcov) ///
star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label ///
nonotes nogaps ///
mgroup("CW" "Post-CW" "CW" "Post-CW", pattern(1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
nomtitles ///
stats(controls ldrfe yrfe r2_a nldr N, labels("Controls" "Leader fixed-effects" "Year fixed-effects" "Adjusted R$^2$" "Number of leaders" "Observations") fmt(0 0 0 3 0 0)) ///
replace tex

****************
*** Table E2 ***
****************

global main = "hrs_violations hrs_violations_ideal_diff hrs_violations_democratic hrs_violations_ideal_diff_demo ideal_diff ideal_diff_democratic"

eststo m1: reghdfe lead_lnnytimes_windex_newsnum $main, $spec
estadd local controls ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'

eststo m2: reghdfe lead_lnnytimes_windex_newsnum $main $domesticcov $intlcov, $spec
estadd local controls "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'

eststo m3: reghdfe lead_lnwp_newsnum $main, $spec
estadd local controls ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'

eststo m4: reghdfe lead_lnwp_newsnum $main $domesticcov $intlcov, $spec
estadd local controls "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'

eststo m5: reghdfe lead_lnwsj_newsnum $main, $spec
estadd local controls ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'

eststo m6: reghdfe lead_lnwsj_newsnum $main $domesticcov $intlcov, $spec
estadd local controls "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'

eststo m7: reghdfe lead_lnchicagotri_newsnum $main, $spec
estadd local controls ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'

eststo m8: reghdfe lead_lnchicagotri_newsnum $main $domesticcov $intlcov, $spec
estadd local controls "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'

eststo m9: reghdfe lead_lnlatimes_newsnum $main, $spec
estadd local controls ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'

eststo m10: reghdfe lead_lnlatimes_newsnum $main $domesticcov $intlcov, $spec
estadd local controls "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'

esttab m1 m2 m3 m4 m5 m6 m7 m8 m9 m10 using "Table_hrviolations_mediaattention_by_demrep_bymedia.tex", b(3) se(3) noomitted ///
keep($main) ///
order($main $domesticcov $intlcov) ///
star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label ///
nonotes nogaps ///
mgroup("NYT" "WP" "WSJ" "CT" "LAT", pattern(1 0 1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
nomtitles ///
stats(controls ldrfe yrfe r2_a nldr N, labels("Controls" "Leader fixed-effects" "Year fixed-effects" "Adjusted R$^2$" "Number of leaders" "Observations") fmt(0 0 0 3 0 0 0)) ///
replace tex

****************
*** Table E3 ***
****************

eststo clear 

global spec = "ab(obsid_num year) vce(cluster obsid_num)"

global main = "hrs_violations ideal_diff"

eststo m1: reghdfe lead_lnnytapi_newsnum_pos $main, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m2: reghdfe lead_lnnytapi_newsnum_pos $main $domesticcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m3: reghdfe lead_lnnytapi_newsnum_pos $main $domesticcov $intlcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

global main = "hrs_violations hrs_violations_ideal_diff ideal_diff"

eststo m4: reghdfe lead_lnnytapi_newsnum_pos $main, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m5: reghdfe lead_lnnytapi_newsnum_pos $main $domesticcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m6: reghdfe lead_lnnytapi_newsnum_pos $main $domesticcov $intlcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

esttab m1 m2 m3 m4 m5 m6 using "Table_hrviolations_mediaattention_nytcoverage_pos.tex", b(3) se(3) noomitted ///
keep($main $domesticcov $intlcov) ///
order($main $domesticcov $intlcov) ///
star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label ///
nomtitles nonotes nogaps ///
mgroup("Ln(\# NYT Positive Mentions)", pattern(1 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
stats(ldrfe yrfe r2_a nldr N period, labels("Leader fixed-effects" "Year fixed-effects" "Adjusted R$^2$" "Number of leaders" "Observations" "Period") fmt(0 0 3 0 0 0)) ///
replace tex

****************
*** Table E4 ***
****************

eststo clear 

global spec = "ab(obsid_num year) vce(cluster obsid_num)"

global main = "hrs_violations ideal_diff"

eststo m1: reghdfe lead_lnnytapi_newsnum_neg $main, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m2: reghdfe lead_lnnytapi_newsnum_neg $main $domesticcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m3: reghdfe lead_lnnytapi_newsnum_neg $main $domesticcov $intlcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

global main = "hrs_violations hrs_violations_ideal_diff ideal_diff"

eststo m4: reghdfe lead_lnnytapi_newsnum_neg $main, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m5: reghdfe lead_lnnytapi_newsnum_neg $main $domesticcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m6: reghdfe lead_lnnytapi_newsnum_neg $main $domesticcov $intlcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

esttab m1 m2 m3 m4 m5 m6 using "Table_hrviolations_mediaattention_nytcoverage_neg.tex", b(3) se(3) noomitted ///
keep($main $domesticcov $intlcov) ///
order($main $domesticcov $intlcov) ///
star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label ///
nomtitles nonotes nogaps ///
mgroup("Ln(\# NYT Negative Mentions)", pattern(1 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
stats(ldrfe yrfe r2_a nldr N period, labels("Leader fixed-effects" "Year fixed-effects" "Adjusted R$^2$" "Number of leaders" "Observations" "Period") fmt(0 0 3 0 0 0)) ///
replace tex

****************
*** Table F1 ***
****************

eststo clear 

global spec = "ab(obsid_num year) vce(cluster obsid_num)"

global main = "hrs_violations hrs_violations_ideal_diff ideal_diff"

eststo m1: reghdfe lead_lnnytimes_windex_newsnum $main, $spec
estadd local controls ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'

eststo m2: reghdfe lead_lnnytimes_windex_newsnum $main $domesticcov $intlcov, $spec
estadd local controls "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'

eststo m3: reghdfe lead_lnwp_newsnum $main, $spec
estadd local controls ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'

eststo m4: reghdfe lead_lnwp_newsnum $main $domesticcov $intlcov, $spec
estadd local controls "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'

eststo m5: reghdfe lead_lnwsj_newsnum $main, $spec
estadd local controls ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'

eststo m6: reghdfe lead_lnwsj_newsnum $main $domesticcov $intlcov, $spec
estadd local controls "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'

eststo m7: reghdfe lead_lnchicagotri_newsnum $main, $spec
estadd local controls ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'

eststo m8: reghdfe lead_lnchicagotri_newsnum $main $domesticcov $intlcov, $spec
estadd local controls "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'

eststo m9: reghdfe lead_lnlatimes_newsnum $main, $spec
estadd local controls ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'

eststo m10: reghdfe lead_lnlatimes_newsnum $main $domesticcov $intlcov, $spec
estadd local controls "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'

esttab m1 m2 m3 m4 m5 m6 m7 m8 m9 m10 using "Table_hrviolations_mediaattention_bymedia.tex", b(3) se(3) noomitted ///
keep($main) ///
order($main $domesticcov $intlcov) ///
star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label ///
nonotes nogaps ///
mgroup("NYT" "WP" "WSJ" "CT" "LAT", pattern(1 0 1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
nomtitles ///
stats(controls ldrfe yrfe r2_a nldr N, labels("Controls" "Leader fixed-effects" "Year fixed-effects" "Adjusted R$^2$" "Number of leaders" "Observations") fmt(0 0 0 3 0 0)) ///
replace tex

****************
*** Table F2 ***
****************

eststo clear 

global spec = "ab(obsid_num year) vce(cluster obsid_num)"

global main = "lead_lnnytapi_newsnum hrs_violations ideal_diff"

eststo m1: reghdfe lead_nytapi_senti $main, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m2: reghdfe lead_nytapi_senti $main $domesticcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m3: reghdfe lead_nytapi_senti $main $domesticcov $intlcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

global main = "lead_lnnytapi_newsnum hrs_violations hrs_violations_ideal_diff ideal_diff"

eststo m4: reghdfe lead_nytapi_senti $main, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m5: reghdfe lead_nytapi_senti $main $domesticcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m6: reghdfe lead_nytapi_senti $main $domesticcov $intlcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

esttab m1 m2 m3 m4 m5 m6 using "Table_hrviolations_mediatone.tex", b(3) se(3) noomitted ///
keep($main) ///
order($main) ///
star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label ///
nomtitles nonotes nogaps ///
mgroup("NYT Tone", pattern(1 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
stats(domesticcov intlcov ldrfe yrfe r2_a nldr N period, labels("Domestic Controls" "U.S.-related controls" "Leader fixed-effects" "Year fixed-effects" "Adjusted R$^2$" "Number of leaders" "Observations" "Period") fmt(0 0 0 0 3 0 0 0)) ///
replace tex

****************
*** Table F3 ***
****************

eststo clear 

global spec = "ab(obsid_num year) vce(cluster obsid_num)"

global main = "hrs_violations hrs_violations_ideal_diff ideal_diff"

preserve 

keep if mindist_to_us_bottom50 == 1

eststo m1: reghdfe lead_lnave_newsnum $main, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m2: reghdfe lead_lnave_newsnum $main $domesticcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m3: reghdfe lead_lnave_newsnum $main $domesticcov $intlcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

restore

preserve 

keep if mindist_to_us_top50 == 1

eststo m4: reghdfe lead_lnave_newsnum $main, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m5: reghdfe lead_lnave_newsnum $main $domesticcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m6: reghdfe lead_lnave_newsnum $main $domesticcov $intlcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

restore

esttab m1 m2 m3 m4 m5 m6 using "Table_hrviolations_mediaattention_bydistance.tex", b(3) se(3) noomitted ///
keep($main) ///
order($main) ///
star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label ///
nomtitles nonotes nogaps ///
mgroup("Min. Dist. below Median" "Min. Dist. above Median", pattern(1 0 0 1 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
stats(domesticcov intlcov ldrfe yrfe r2_a nldr N period, labels("Domestic controls" "U.S.-related controls" "Leader fixed-effects" "Year fixed-effects" "Adjusted R$^2$" "Number of leaders" "Observations" "Period") fmt(0 0 0 0 3 0 0 0)) ///
replace tex

****************
*** Table C1 ***
****************

global domesticcov = "lngdp gdpgrowth lnpopulation lnoil polyarchy presidentialism hrs_violations mediascore election intrastate_conflict interstate_conflict"
global intlcov = "unsc_temp ally log_imports log_exports log_econaid log_milaid visit_from_us_pres visit_in_us_any"

gen lnprotest_ideal_diff = lnprotest*ideal_diff
label var lnprotest_ideal_diff "$\times$ UNGA Ideal Pt. Dist."

eststo clear 

global spec = "ab(obsid_num year) vce(cluster obsid_num)"

global main = "lnprotest ideal_diff"

eststo m1: reghdfe lead_lnave_newsnum $main, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m2: reghdfe lead_lnave_newsnum $main $domesticcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m3: reghdfe lead_lnave_newsnum $main $domesticcov $intlcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

global main = "lnprotest lnprotest_ideal_diff ideal_diff"

eststo m4: reghdfe lead_lnave_newsnum $main, $spec
estadd local domesticcov ""
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m5: reghdfe lead_lnave_newsnum $main $domesticcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov ""
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

eststo m6: reghdfe lead_lnave_newsnum $main $domesticcov $intlcov, $spec
estadd local domesticcov "$\checkmark$"
estadd local intlcov "$\checkmark$"
estadd local ldrfe "$\checkmark$"
estadd local yrfe "$\checkmark$"
estadd local nldr `e(N_clust)'
estadd local period "1960-2015"

esttab m1 m2 m3 m4 m5 m6 using "Table_protest_mediaattention.tex", b(3) se(3) noomitted ///
keep($main $domesticcov $intlcov) ///
order($main $domesticcov $intlcov) ///
star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label ///
nomtitles nonotes nogaps ///
mgroup("Ln(Ave. \# Newsp. Mentions)", pattern(1 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
stats(ldrfe yrfe r2_a nldr N period, labels("Leader fixed-effects" "Year fixed-effects" "Adjusted R$^2$" "Number of leaders" "Observations" "Period") fmt(0 0 3 0 0 0)) ///
replace tex

*****************
*** Figure C1 ***
*****************

interflex lead_lnave_newsnum lnprotest ideal_diff, cluster(obsid_num) fe(obsid_num year) ylabel("Y") xlabel("UNGA Ideal Pt. Dist.") title("D = Ln(Protest Events) (w/o controls)") yrange(-0.5 0.5) 
graph rename Figure_A, replace

interflex lead_lnave_newsnum latent_protest ideal_diff, cluster(obsid_num) fe(obsid_num year) ylabel("Y") xlabel("UNGA Ideal Pt. Dist.") title("D = Latent Protest (w/o controls)") yrange(-0.5 0.5) 
graph rename Figure_B, replace

interflex lead_lnave_newsnum lnprotest ideal_diff $domesticcov $intlcov, cluster(obsid_num) fe(obsid_num year) ylabel("Y") xlabel("UNGA Ideal Pt. Dist.") title("D = Ln(Protest Events) (w/ controls)") yrange(-0.5 0.5)
graph rename Figure_C, replace

interflex lead_lnave_newsnum latent_protest ideal_diff $domesticcov $intlcov, cluster(obsid_num) fe(obsid_num year) ylabel("Y") xlabel("UNGA Ideal Pt. Dist.") title("D = Latent Protest (w/ controls)") yrange(-0.5 0.5)
graph rename Figure_D, replace

graph combine Figure_A Figure_B Figure_C Figure_D, col(2) xcommon ycommon
graph export "Figure_protest_mediaattention.png", replace
